Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(GraphQL): Fix duplicate XID error in case of interface XIDs #7776

Merged
merged 4 commits into from
May 11, 2021

Conversation

vmrajas
Copy link
Contributor

@vmrajas vmrajas commented May 4, 2021

Implementation:
This PR adds the implementing type name to the key. This ensures that different variable names are generated for different implementing types of the same interface with same XID (name and value). It also adds an error condition to give error in case two nodes of different types with same XID(with interface=true) flag are added.

It also fixes other bug related to referencing same node with multiple IDs in same mutation.

Testing:
Added yaml and e2e tests.
Note that two tests from yaml tests have been removed as they were wrong.

Fixes GRAPHQL-1164


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label May 4, 2021
@@ -2741,43 +2743,6 @@
message: |-
failed to rewrite mutation payload because duplicate XID found: S1

- name: "Duplicate XIDs in single mutation for Interface"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this test as it was wrong. As xid does not have interface=true flag. It is perfectly fine to have Student and Teacher with same xid.

@@ -1457,48 +1457,6 @@
message: |-
failed to rewrite mutation payload because duplicate XID found: T1

- name: "Duplicate XIDs in single mutation for Interface"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this test as it was wrong. As xid does not have interface=true flag. It is perfectly fine to have Student and Teacher with same xid.

@vmrajas vmrajas merged commit 6fbca75 into master May 11, 2021
@vmrajas vmrajas deleted the rajas/GRAPHQL-1164 branch May 11, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

2 participants